<?php //$Id: maskPhone.php,v 1.1.1.1 2014/08/23 06:57:06 ymlam Exp $ Copyright (C) 2014 Link2Tek LLC ?>
<?php
// $Id: maskPhone.php,v 1.1.1.1 2014/08/23 06:57:06 ymlam Exp $

/**
 * Mask US phone number, revealing last 4 digits.
 */
function maskPhone($phone)
{
  if (strlen($phone) < 4) return $phone;
  return '1-XXX-XXX-'.substr($phone, strlen($phone) - 4);
}

?>
